Skip to content

feat: add schema versioning to registry index and pack metadata#3

Merged
breferrari merged 1 commit into
mainfrom
feat/schema-versioning
Mar 25, 2026
Merged

feat: add schema versioning to registry index and pack metadata#3
breferrari merged 1 commit into
mainfrom
feat/schema-versioning

Conversation

@breferrari

Copy link
Copy Markdown
Contributor

Summary

  • Adds schema_version: 1 to index.json (envelope format: {"schema_version": 1, "packs": {…}})
  • Adds schema_version: 1 to each packs/{name}.json as a top-level field
  • Updates scripts/generate.py to emit REGISTRY_SCHEMA_VERSION (currently 1) in all generated files

This enables forward compatibility: older weave clients can detect registry formats they cannot safely parse and display a clear "please upgrade weave" error instead of silently misinterpreting data.

Companion PR

Test plan

  • generate.py runs successfully and regenerates all 13 packs + index
  • index.json has correct envelope structure with schema_version: 1
  • Each packs/{name}.json includes schema_version: 1 as first field
  • Weave client tests pass with both new envelope and legacy flat formats

Add forward-compatible schema versioning to all generated registry files:

- index.json now uses envelope format: {"schema_version": 1, "packs": {…}}
- Each packs/{name}.json includes a top-level schema_version field
- generate.py emits REGISTRY_SCHEMA_VERSION (currently 1) in both formats

This enables older weave clients to detect and reject registry formats
they cannot safely parse, displaying a clear "please upgrade" message.

Companion to breferrari/weave#237.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds explicit schema versioning to the generated registry artifacts so clients can detect (and error on) unsupported registry formats, enabling safer forward compatibility.

Changes:

  • Emit schema_version: 1 in each generated packs/{name}.json.
  • Change index.json to an envelope format: {"schema_version": 1, "packs": { ... }}.
  • Update scripts/generate.py to centralize the schema version via REGISTRY_SCHEMA_VERSION.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
scripts/generate.py Introduces REGISTRY_SCHEMA_VERSION and updates pack + index generation to emit schema versioned outputs.
index.json Switches to schema-versioned envelope with packs payload.
packs/brave-search.json Adds top-level schema_version.
packs/docs-writer.json Adds top-level schema_version.
packs/fetch.json Adds top-level schema_version.
packs/filesystem.json Adds top-level schema_version.
packs/git-tools.json Adds top-level schema_version.
packs/github.json Adds top-level schema_version.
packs/memory.json Adds top-level schema_version.
packs/postgres.json Adds top-level schema_version.
packs/python-dev.json Adds top-level schema_version.
packs/rust-dev.json Adds top-level schema_version.
packs/sequential-thinking.json Adds top-level schema_version.
packs/sqlite.json Adds top-level schema_version.
packs/web-dev.json Adds top-level schema_version.
Comments suppressed due to low confidence (1)

scripts/generate.py:13

  • The module docstring still describes index.json being regenerated "as a flat catalog" with latest_version entries. Since regenerate_index() now emits an envelope with {schema_version, packs}, this description is now inaccurate and should be updated to match the new on-disk format.
  1. Reads all files and builds an inline `files` map (relative path -> content).
  2. Parses pack.toml to extract metadata (version, description, authors, etc.).
  3. Writes packs/{name}.json — creating it or updating the version entry in place.

Then regenerates index.json as a flat catalog of all packs with latest_version

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@breferrari
breferrari merged commit b647337 into main Mar 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants